<?php
# 001 先连接数据库
$db = mysqli_connect("127.0.0.1","root","","kaola");

$phone = $_REQUEST["phone"];

$sql = "SELECT * FROM user WHERE phone='$phone'";
$result = mysqli_query($db,$sql);
if (mysqli_num_rows($result) == 0)
{
  $response["status"] = "error";
  $response["msg"] = "该用户不存在！！";
  echo json_encode($response, true);
}else{
    $response["status"] = "success";
    $response["msg"] = "登录成功";
    echo json_encode($response, true);
}
?>